package day16.pack2;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public class TestOutputStream1 {
    public static void main(String[] args) throws IOException {
        File file = new File("d:\\seecen.txt");
        if(!file.exists()) file.createNewFile();
        // helloworld,思诚科技!
        OutputStream os = null;
        try {
            // 默认false， 不追加覆盖。
            os = new FileOutputStream(file, true);
            os.write(99);
            os.write(100);
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            if(os != null) os.close();
        }

    }
}
